package com.link2room.rodimus.controller.inside;

import com.link2room.aeriabots.dto.param.inside.WebPaymentInsideParamDto;

import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.common.util.ClassConverUtil;
import com.link2room.rodimus.dto.param.inside.MallOrderPayInsideParamDto;
import com.link2room.rodimus.facade.IMallInsideFacadeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Created by VegetaKo on 2017/3/20.
 */
@Api(tags = "商城相关")
@RestController
@RequestMapping("/in/Mall")
public class MallInsideController {

    @Resource
    private IMallInsideFacadeService mallInsideFacadeService;

    @RequestMapping(value="/MallOrderPayNotify",method = RequestMethod.POST)
    public BaseResultDto orderPayNotify(
            @RequestBody WebPaymentInsideParamDto webPaymentInsideParamDto
            ) throws Exception {

        MallOrderPayInsideParamDto mallOrderPayInsideParamDto = new MallOrderPayInsideParamDto();
        ClassConverUtil.copyProperties(webPaymentInsideParamDto, mallOrderPayInsideParamDto);
        BaseResultDto resDto = new BaseResultDto();
        mallInsideFacadeService.NotifyOrderPay(mallOrderPayInsideParamDto);
        resDto.setResultCode(0);
        return resDto;
    }
}
